#!/bin/bash
export PYTHONUNBUFFERED=1

model=qwen1.8b.chat
new_date=$(date +%Y-%m-%d)_${model}
if [ ! -d "log/$new_date" ]; then
    mkdir -p "log/$new_date"
fi

model_name=Qwen-1_8B-Chat
data_type=CKnowEdit
data_path=../../EasyEdit/dataset/ccks2024_know_edit/ccks-CKnowEdit.json
source activate torch23py310
export HUGGINGFACE_CACHE=/root/huggingface/

batch_size=20
layer_idx=5,12
# layer_idx=12,24
prob_type=target_new
start_idx=258
end_idx=259 # 700-277
i=1
ff_attrs=mlp.w1
echo "$i $model_name $data_type $batch_size $prob_type $ff_attrs $layer_idx $start_idx $end_idx"
CUDA_VISIBLE_DEVICES=$i python kn.py \
    --model_name $model_name \
    --start_idx $start_idx \
    --end_idx  $end_idx \
    --batch_size $batch_size \
    --data_type $data_type \
    --data_path $data_path \
    --transformer_layers_attr transformer.h \
    --ff_attrs $ff_attrs \
    --prob_type $prob_type \
    --layer_idx $layer_idx \
    --steps $batch_size \
    --next_token answer_next_token \
    > log/$new_date/$i-$model-$data_type-$layer_idx-$start_idx-$end_idx-bs$batch_size-$prob_type-$ff_attrs-1.log 2>&1 &
